package com.lrkj.back.vo;

/**
 * Created by daiwe on 2017/7/20.
 */
public class MoneyTest {

    public static final int ben = 5000;
    public static  int yin  ;

    public static void main(String [] args){
//        yin = ben*12*5;

        MoneyTest moneyTest = new MoneyTest();
        double mon = moneyTest.math(119,ben,0.025);
        double zen = moneyTest.yinhangmath(1,ben*12*5,0.0275);
        System.out.print(mon+"，"+zen);


    }

    public double math(int count,double money,double shouyi){
        count--;
        money = money*(1+shouyi)+ben;
        if(count>0){
            money = math(count,money,shouyi);
        }
        return money;


    }

    public double yinhangmath(int year, double money,double shouyi){
        year--;
        money += money*(shouyi*5+1);
        if(year>0){
            money = yinhangmath(year,money,shouyi);
        }

        return money;
    }

}
